(旧Siv3D) ウィンドウのリサイズ中は描画を抑制する
code:nodraw_during_resize.cpp
void Main()
{
ScalableWindow::Setup(640, 480);
Graphics::SetBackground(Palette::White);
Stopwatch resizeWatch(true);
Size windowSize = Window::Size();
while (System::Update())
{
// Monitor window size
if (windowSize != Window::Size())
{
resizeWatch.restart();
}
if (resizeWatch.ms() > 500)
{
resizeWatch.pause();
}
windowSize = Window::Size();
// Draw something ...
Window::ClientRect().draw(Palette::Black);
if (resizeWatch.ms() > 500)
{
const auto transformer = ScalableWindow::CreateTransformer();
Window::BaseClientRect().draw(Palette::Yellow).drawFrame(10.0, 2.0, Palette::Orange);
}
ScalableWindow::DrawBlackBars(Palette::Gray);
}
}